package com.itheima.stock.controller;


import com.itheima.stock.domain.*;
import com.itheima.stock.service.StockService;
import com.itheima.stock.vo.resp.PageResult;
import com.itheima.stock.vo.resp.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gc
 * @version 1.0.0
 * @description  股票业务的Controller
 * @date 2023-02-26 14:33
 */
@RestController
public class StockController {

    @Autowired
    private StockService stockService;

    /**
     * 个股日K线详情
     * @param stockCode
     * @return
     */
    @GetMapping("/api/quot/stock/screen/dkline")
    public R<List<Stock4EvrDayDomain>> getDayKLinData(@RequestParam("code") String stockCode){
        return stockService.getDayKLinData(stockCode);
    }

    /**
     * 个股分时K线详情
     * @param stockCode
     * @return
     */
    @GetMapping("/api/quot/stock/screen/time-sharing")
    public R<List<Stock4MinuteDomain>> stockScreenTimeSharing(@RequestParam("code") String stockCode){
        return stockService.stockScreenTimeSharing(stockCode);
    }

    @GetMapping(path = "/api/quot/stock/all")
    public R<PageResult<StockUpdownDomain>> stockGetLimit(Long page,Long pageSize){
       return stockService.stockGetLimit(page,pageSize);
    }

    @GetMapping(path = "/api/quot/stock/increase")
    public R<List<StockUpdownDomain>> stockIncreaseLimit(){
        return stockService.stockIncreaseLimit();
    }




    @GetMapping(path = "/api/quot/sector/all")
    public R<List<StockBlockRtInfoDomain>> sectorAll(){
        return stockService.sectorAll();
    }


    @GetMapping(path = "/api/quot/index/all")
    public R<List<InnerMarketDomain>> innerIndexAll(){
        return stockService.innerIndexAll();
    }


}